<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>04-绘制矩形</title>
    <style>
      /* canvas {
        border: 1px solid rebeccapurple;
      } */
    </style>
  </head>
  <body>
    <canvas width="600" height="500"></canvas>
    <script>
      const canvas = document.querySelector('canvas');
      const ctx = canvas.getContext('2d');

      ctx.fillStyle = 'lightgreen';
      ctx.fillRect(480, 200, 120, -160);
      ctx.strokeStyle = 'red';
      ctx.strokeRect(200, 150, 200, 200);
    </script>
  </body>
</html>
